<template>
	<view class="content">
		<view class="message_item" v-for="(item,index) in listData" :key="index">
			<view class="platform_icon" v-if="item.createBy=='admin'">
				平台消息
			</view>
			<view class="message_title">
				{{item.smsTitle}}
			</view>
			<view class="message_date">
				{{item.createTime}}
			</view>
			<view class="message_content">
				
				<text>
					{{item.smsContent}}
				</text>
			</view>
		</view>
		
		<view>
			<uni-load-more :status="loadStatus"></uni-load-more>
		</view>

	</view>
</template>

<script>
	import myMixin from "../../static/js/mixin.js"
	export default {
		data() {
			return {

			}
		},
		mixins: [myMixin],
		onShow() {

		},
		methods: {
			initData() {
				this.$http.get(`/api/user/userIntegralDetails`, {
					areaCode: this.cityCode,
					type: 0,
					pageRow: this.pageRow,
					pageSize: this.pageSize
				}).then((data) => {
					if (data.data.code == 200) {
						if (this.pageRow != 1) {
							this.listData = this.listData.concat(data.data.result.records);
						} else {
							this.listData = data.data.result.records;

						}
						if (data.data.result.records.length) {
							if (data.data.result.records.length < this.pageSize) { //判断接口返回数据量小于请求数据量，则表示此为最后一页
								this.isLoadMore = true
								this.loadStatus = 'nomore';

							} else {
								this.isLoadMore = false;
								this.loadStatus = 'more';
							}
						} else {
							this.isLoadMore = true
							this.loadStatus = 'nomore'
						}
					}
				}).catch(() => {
					this.isLoadMore = true
					this.loadStatus = 'nomore'
				})
			}
		}
	}
</script>
</script>

<style lang="scss" scoped>
	@import '@/static/css/message.scss'
</style>
